try { var dummy = RMITester; } catch ( e ) {


function RMITester(){
}

// Required for AS 1 inheritance.
RMITester.prototype = new RTCFComponent();


RMITester.prototype.init = function(){

	// Allow this method to be called from clients in any role:
	this.allowRemoteCall("test");

	this.rtcf.addListener("onAuthorizedConnect", this);
	
	this.responder = {};
	this.responder.onResult = function(result){
		trace("RMITester responder.onResult> " + result);
	} 	
	this.responder.onStatus = function(status){
		trace("RMITester responder.onStatus> " + status);
	}
	
		
}

/** remote method to be called */
RMITester.prototype.test = function(){
	var str = "Server received these arguments: ";
	var ar = [];
	
	for (var i = 0; i < arguments.length; i++){
		trace("  received arguments[" + i + "]: " + arguments[i] + " type: " + typeof arguments[i]);
		ar.push(arguments[i]);
	}
	trace("RMITester.test> client to server function call received with parameters: " + ar);
	return str + ar.join(", ");
}

/** After the client has been accepted call a remote method on this component's proxy. */
RMITester.prototype.onAuthorizedConnect = function(client){ 	
	this.callClientRTCFComponent(client, 'test', this.responder, 'hi', 'bye')
}




} // end catch

